#include "mem.h"

int word_align_up(int size)
{
    int ws = sizeof(void *);
    switch (ws)
    {
    case 8:
        size = (size + 7) & 0xfffffffffffffff8u;
        break;
    default:
        size = (size + 3) & 0xfffffffcu;
        break;
    }
    return size;
}

int word_align_down(int size)
{
    int ws = sizeof(void *);
    switch (ws)
    {
    case 8:
        size &= 0xfffffffffffffff8u;
        break;

    default:
        size &= 0xfffffffcu;
        break;
    }
    return size;
}